package com.alex.core.session;

import javax.servlet.http.HttpServletRequest;

public class SessionUtils {

    public static String getSessionId(HttpServletRequest request) {
        return request.getSession().getId();
    }

    public static <T> T get(String sessionKey, HttpServletRequest request) {
        return (T) request.getSession().getAttribute(sessionKey);
    }

    public static void remove(String sessionKey, HttpServletRequest request) {
        request.getSession().removeAttribute(sessionKey);
    }
}
